'\" t
.\"     Title: DROP OPERATOR CLASS
.\"    Author: The PostgreSQL Global Development Group
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 2011-12-01
.\"    Manual: PostgreSQL 9.1.2 Documentation
.\"    Source: PostgreSQL 9.1.2
.\"  Language: English
.\"
.TH "DROP OPERATOR CLASS" "7" "2011-12-01" "PostgreSQL 9.1.2" "PostgreSQL 9.1.2 Documentation"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
DROP_OPERATOR_CLASS \- remove an operator class
.\" DROP OPERATOR CLASS
.SH "SYNOPSIS"
.sp
.nf
DROP OPERATOR CLASS [ IF EXISTS ] \fIname\fR USING \fIindex_method\fR [ CASCADE | RESTRICT ]
.fi
.SH "DESCRIPTION"
.PP

DROP OPERATOR CLASS
drops an existing operator class\&. To execute this command you must be the owner of the operator class\&.
.PP

DROP OPERATOR CLASS
does not drop any of the operators or functions referenced by the class\&. If there are any indexes depending on the operator class, you will need to specify
CASCADE
for the drop to complete\&.
.SH "PARAMETERS"
.PP
IF EXISTS
.RS 4
Do not throw an error if the operator class does not exist\&. A notice is issued in this case\&.
.RE
.PP
\fIname\fR
.RS 4
The name (optionally schema\-qualified) of an existing operator class\&.
.RE
.PP
\fIindex_method\fR
.RS 4
The name of the index access method the operator class is for\&.
.RE
.PP
CASCADE
.RS 4
Automatically drop objects that depend on the operator class\&.
.RE
.PP
RESTRICT
.RS 4
Refuse to drop the operator class if any objects depend on it\&. This is the default\&.
.RE
.SH "NOTES"
.PP

DROP OPERATOR CLASS
will not drop the operator family containing the class, even if there is nothing else left in the family (in particular, in the case where the family was implicitly created by
CREATE OPERATOR CLASS)\&. An empty operator family is harmless, but for the sake of tidiness you might wish to remove the family with
DROP OPERATOR FAMILY; or perhaps better, use
DROP OPERATOR FAMILY
in the first place\&.
.SH "EXAMPLES"
.PP
Remove the B\-tree operator class
widget_ops:
.sp
.if n \{\
.RS 4
.\}
.nf
DROP OPERATOR CLASS widget_ops USING btree;
.fi
.if n \{\
.RE
.\}
.sp
This command will not succeed if there are any existing indexes that use the operator class\&. Add
CASCADE
to drop such indexes along with the operator class\&.
.SH "COMPATIBILITY"
.PP
There is no
DROP OPERATOR CLASS
statement in the SQL standard\&.
.SH "SEE ALSO"
ALTER OPERATOR CLASS (\fBALTER_OPERATOR_CLASS\fR(7)), CREATE OPERATOR CLASS (\fBCREATE_OPERATOR_CLASS\fR(7)), DROP OPERATOR FAMILY (\fBDROP_OPERATOR_FAMILY\fR(7))
